<?php

namespace app\model;

use support\Model;

/**
/**
 * 表结构说明（参考 20250724075356_create_refund_record_table_migration.php）：
 * 
 * refund_record 表字段：
 * - id             : int, 主键，自增
 * - type           : string(16), 退款类型，默认 'biz-order'
 * - item_id        : int(11), 关联ID，默认 0
 * - refund_amount  : decimal(10,2), 退款金额
 * - refund_at      : int, 退款时间，默认 0
 * - status         : string(16), 状态 doing, success, failed，默认 'doing'
 * - created_at     : int, 创建时间
 * - updated_at     : int, 更新时间
 */

class RefundRecordModel extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'refund_record';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    protected $guarded = [];

    const TYPE = [
        'biz-order' => '消费订单',
        'pay' => '随心付',
        'order' => '严选订单',
        'store' => '商家订单',
    ];

    const STATUS_TEXT = [
        'doing' => '退款中',
        'success' => '退款成功',
        'failed' => '退款失败',
    ];
}